Python Scripting
You can script inside Guerilla using Python.
See the python SDK for more details.
Guerilla supports both Python 2 and Python 3. By default, Guerilla first
search for Python 2.6 (python26.dll on Windows, libpython2.6.so on Linux),
and falls back on Python 2.7 (python27.dll on Windows, libpython2.7.so on Linux).
Window
Guerilla Windows is natively shiped with a Python 2.6 library, so Guerilla does not require
you have Python install. If you need a specific version of Python, refer to the 'Use a specific Python
library' section below.
Linux
Guerilla Linux uses the system Python library. You need a Python 2.6 or 2.7
installed on your system. Guerilla will try to load libpython2.6.so or libpython2.7.so.
You may have to add the path to the libray in your LD_LIBRARY_PATH.
When running Guerilla from Autodesk Maya, you may have to override the
actual location of the Python library to use. See 'Use a specific Python
library' below.
Source python scripts at startup
At startup, Guerilla sources all the .py files stored in the plugins directory of
your installation and in the directories specified in the
UserPlugins configuration variable.
Use a specific Python library
Python 2.x
Set the PythonLibrary configuration variable to the path of
your Python library. For example, PythonLibrary = C:/Python27/python27.dll on Windows,
PythonLibrary = /usr/lib/x86_64-linux-gnu/libpython2.7.so on Linux
Python 3.x
To enable Python 3 support, set Python3 = python-version, where
python-version can be either 3.6, 3.7, 3.8, 3.9 or 3.10. You must also set
Python3Library to the path of the Python 3 library. For example,
Python3Library = C:/Python38/python38.dll on Windows,
Python3Library = /usr/lib/x86_64-linux-gnu/libpython3.8.so on Linux.
Python 3.10 support requires the library name to be python310.dll on Windows,
and libpython3.10.so.1.0 on Linux. Create a symbolic link to your Python library if
this is not the case.
You can use GUERILLA_PYTHON_LIBRARY environment variable instead of
PythonLibrary, GUERILLA_PYTHON3 instead of Python3 and
GUERILLA_PYTHON3_LIBRARY instead of Python3Library.